package com.cal.utms.action.maintenance;

import com.cal.utms.dto.maintenance.HolidayCalendarDto;
import com.cal.utms.model.maintenance.HolidayModel;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class HolidayAction extends ActionSupport implements ModelDriven<HolidayCalendarDto> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private HolidayCalendarDto calendarDto = new HolidayCalendarDto();
	HolidayModel holidayModel = new HolidayModel();
	private String holidayList;

	public String saveHoliday() {
		holidayModel.saveHoliday(calendarDto, holidayList);
		return Action.SUCCESS;
	}

	public String getAllHolidays() {
		calendarDto.setCalendarDtos(holidayModel.getHolidays());
		return Action.SUCCESS;
	}

	public String getBankHolidays() {
		calendarDto.setCalendarDtos(holidayModel.getBankHolidays());
		return Action.SUCCESS;
	}

	@Override
	public HolidayCalendarDto getModel() {
		return calendarDto;
	}

	public HolidayCalendarDto getCalendarDto() {
		return calendarDto;
	}

	public void setCalendarDto(HolidayCalendarDto calendarDto) {
		this.calendarDto = calendarDto;
	}

	public String getHolidayList() {
		return holidayList;
	}

	public void setHolidayList(String holidayList) {
		this.holidayList = holidayList;
	}

}
